package demo2;

public class Test_2 {
    public  static  void  fun1(Anima1 anima1){
         anima1.play();
    }
public  static  void run(IRunning iRunning){
    iRunning.run();
}
    public static  void  swim(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void main(String[] args) {
       // Object obj = new Dog("111",22);
        fun1(new Dog("布鲁斯",22));
        fun1(new Cat("kitty",17));
        run(new Dog("布鲁斯",22));
        run(new Cat("kitty",17));
        swim(new Cat("kitty",17));
        swim(new Dog("布鲁斯",22));
    }

}
